package com.hjw.inheritance.junit;

import com.hjw.inheritance.exer2.*;

import java.util.Random;

/**
 * @author hjwStrart
 * @create 2022-01-12 18:27
 */
public class TestMusician {
    public static void main(String[] args) {
        Musician musician = new Musician();
        Random random = new Random();
        Instrument instrument = null;
        int i = random.nextInt(3) + 1;
        switch (i){
            case 1 : instrument = new Erhu();break;
            case 2 : instrument = new Violin();break;
            case 3 : instrument = new Piano();break;
            default:break;
        }
        System.out.println(i);
        musician.play(instrument);
    }
}
